package org.lztvn.elearning.service;

import java.util.List;

import org.lztvn.elearning.dao.IResponseDao;
import org.lztvn.elearning.entities.Response;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public class ResponseServiceImpl implements IResponseService{
	IResponseDao dao;
	
	public IResponseDao getDao() {
		return dao;
	}

	public void setDao(IResponseDao dao) {
		this.dao = dao;
	}

	public Long addResponse(Response r) {
		return dao.addResponse(r);
	}

	public void deleteResponse(Long idResponse) {
        dao.deleteResponse(idResponse);
	}

	public void modifierResponse(Response r) {
	    dao.modifierResponse(r);
	}

	public List<Response> listResponseByTopicId(Long idTopic, int position,
			int nb_response) {
		return dao.listResponseByTopicId(idTopic, position, nb_response);
	}

	public Response getResponse(Long idResponse) {
		return dao.getResponse(idResponse);
	}

	public Long getNbResponseByResponseId(Long idResponse) {
		return dao.getNbResponseByResponseId(idResponse);
	}

}
